<!doctype html>
<html>

	<head>
		<meta charset="UTF-8">
		<title></title>
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<link rel="stylesheet" type="text/css" href="../../css/mui.css"/>
		<link href="../../css/mui.min.css" rel="stylesheet" />
		<link rel="stylesheet" type="text/css" href="../../css/general.css"/>
		<style type="text/css">
			
			
			textarea{
				width: 100%;
				border: 0;
				padding: 1em;
				background-color: #EFEFF4;
				height: auto;
			}
			.fbut{
				width: 100%;
				position:fixed;
				bottom:0;
				text-align: center;
			}
			#sub{
				width: 100%;
				margin: auto;
				border: 1px solid #7DB1FD;
				line-height: 2;
			}
		</style>
	</head>

	<body>
		<header class="mui-bar mui-bar-nav hbg">
		    <a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left colorw"></a>
		    <h1 class="mui-title">添加跟进记录</h1>
		    
		</header>
		<div class="mui-content">
			<div class="main" id="app">
				<div >
				    <textarea id="text-adaption" rows="" cols="" placeholder="添加跟进记录"></textarea>
				    <div id="textvalue">
				    </div>
				</div>
				<div class="fgd">
				</div>
				<div class="fbut">
				<button type="button" id="sub" class="mui-btn mui-btn-blue">保存</button>
				</div>
			</div>
			
			
		</div>
		<script src="../../js/jquery.min.js" type="text/javascript" charset="utf-8"></script>
		<script src="../../js/mui.min.js"></script>
		<script src="../../js/req.js" type="text/javascript" charset="utf-8"></script>
		<script src="../../js/muishow.js" type="text/javascript" charset="utf-8"></script>
		<script type="text/javascript">
			var mid = 0; //会员id
			window.onload = function(){
				
				mui.init();
				mid = getrequest().mid;
				mui.plusReady(function(){
					
				})
				//监听textarea 改变高度和滚动条
				g("text-adaption").addEventListener("input", function(event) {
					this.style.height = this.scrollHeight + "px";
				  	//document.getElementById("textvalue").innerHTML = this.value.length + "/150";
				  	g("app").scrollTop = this.scrollHeight;
				});
				
				//监听提交
				g("sub").addEventListener("tap",function(e){
					var value = g("text-adaption").value||"";
					if(""==value){
						mui.toast("请输入跟进记录");
						return;
					}
					var data = {
						url:"/api/member_follow_record/add",
						data:{
							access_token:acctoken(),
							member_id:mid,
							content:g("text-adaption").value||""
						}
					}
					ajax(data,function(res){
						console.log(res);
						mui.toast(res.msg);
						back_show();
					
					})
				
				})
			}
				
			
		</script>
	</body>

</html>